Hello,

I am writing here because my application have unexpected
function result.

This function reverse the string content and lower case. For example "AZERTY" is the source then "ytreza" will be the result that I hope to get.

I do not put here the entire code then I summarize it:

Code:
#include <ctype.h>
#include <stdio.h>
#include <string.h>

int main(void)
{
 char kbuff[255];
 parser( &kbuff[0] );
}


int parser( char *kbuff[255] )

{
  int i =0;
  int j;
  char kbufft[15];

  kbufft[0] = '\0';
  j = strlen (kbuff) -1;

  while (  ! ( (i>=5) || (j<0) ) )
        {
   	  kbufft[i] = tolower ( (chr) kbuff[j] );
	  kbufft[i+1]= '\0';
	  i++;
	  j--;
	  printf("my reversed, lowered string is:%s \n", kbufft);
	}


}
I neither use * nor & in my program because I can get value without.

The problem are: kbuff[j] works well only for the last char "y" not for all next. Then, kbufft have 0 length or it is fullfilled with the "y" char.

I conclude that it is impossible to access one by one character in
the char *kbuff variable. To solve the problem I have to create a second variable kbuffx[] inside the function then copy the original to it, I have to work on the copy not the original:

strpcy(kbuffx, kbuff);

My question is why it is impossible to access each character in
pointed string ? The solution I gave is not a good idea because creating a new variable spend memory space.

Does tolower() function cause the problem ?

I think that the memory address of kbuff[] change each time and access element of it is not possible ( but the entire string access is possible).

My system is P4 under LINUX Slackware 10.1 with GCC / GLIBC